<?php //require '../public/system/headers/headers.php';?>
<ul id="main_menu">
    <?php foreach ($this->sitePages as $sitePage): ?>
		<?php if($sitePage['h1'] == 'no category'): ?>
			<?php if(!empty($sitePage['pages'])): ?>
				<li>
					<ul class="nocategory">
						<?php foreach ($sitePage['pages'] as $subPage): ?>
						<li><a title="<?php echo $subPage['h1']; ?>" href="<?php echo ($subPage['url'] != 'index') ? $this->websiteUrl . $subPage['url'] . '.html' : $this->websiteUrl ; ?>" ><?php echo $subPage['navigationTitle']; ?></a></li>
						<?php endforeach; ?>
					</ul>
				</li>
			<?php endif; ?>
	    <?php else: ?>
			<?php $this->classCounter++; ?>
			<li class="cat-<?php echo $this->classCounter; ?> category"><a title="<?php echo $sitePage['h1']; ?>" href="<?php echo $this->websiteUrl . $sitePage['url'] . '.html'; ?>" ><?php echo $sitePage['navigationTitle']; ?></a>
				<?php if(!empty($sitePage['pages'])): ?>
					<ul id="<?php echo $sitePage['url']; ?>">
						<?php foreach ($sitePage['pages'] as $subPage): ?>
						<li class="page"><a title="<?php echo $subPage['h1']; ?>" href="<?php echo ($subPage['url'] != 'index') ? $this->websiteUrl . $subPage['url'] . '.html' : $this->websiteUrl ; ?>" ><?php echo $subPage['navigationTitle']; ?></a></li>
						<?php endforeach; ?>
					</ul>
				<?php endif; ?>
			</li>
		<?php endif; ?>
    <?php endforeach; ?>
</ul>